import request from '@/config/axios'

// 问卷填写记录 VO
export interface QuestionnaireRecordVO {
  id?: number // 编号
  qsId: number // 问卷ID
  dataJson: string // 表单配置
  ipAddr?: string // IP地址
  sort?: number // 排序
  status?: number // 状态
}

// 问卷填写记录 API
export const QuestionnaireRecordApi = {
  // 查询问卷填写记录分页
  getQuestionnaireRecordPage: async (params: any) => {
    return await request.get({ url: `/school/questionnaire-record/page`, params })
  },

  // 查询问卷填写记录详情
  getQuestionnaireRecord: async (id: number) => {
    return await request.get({ url: `/school/questionnaire-record/get?id=` + id })
  },
  // 根据问卷ID查询问卷填写记录
  getQuestionnaireRecordByQsId: async (params: any) => {
    return await request.get({ url: `/school/questionnaire-record/getByQsId`, params })
  },

  // 新增问卷填写记录
  createQuestionnaireRecord: async (data: QuestionnaireRecordVO) => {
    return await request.post({ url: `/school/questionnaire-record/create`, data })
  },

  // 修改问卷填写记录
  updateQuestionnaireRecord: async (data: QuestionnaireRecordVO) => {
    return await request.put({ url: `/school/questionnaire-record/update`, data })
  },

  // 删除问卷填写记录
  deleteQuestionnaireRecord: async (id: number) => {
    return await request.delete({ url: `/school/questionnaire-record/delete?id=` + id })
  },

  // 导出问卷填写记录 Excel
  exportQuestionnaireRecord: async (params) => {
    return await request.download({ url: `/school/questionnaire-record/export-excel`, params })
  }
}
